class PrintChar{

    constructor(char,number){
        this.char = char;
        this.number = number;
    }

    for1(){
        for(let i=0; i<this.number; i++){
            let reStr = "";
            for(let j=0; j<=i; j++){
                reStr += this.char;
            }
            console.log(reStr);
        }
    }

    for2(){
        for(let i=this.number; i>0; i--){
            let reStr = "";
            for(let j=i; j>0; j--){
                reStr += this.char;
            }
            console.log(reStr);
        }
    }

    for3(){
        for(let i=this.number; i>0; i--){
            let reStr = "";
            for(let j=i; j>0; j--){
                reStr += this.char;
            }
            if(i%2 === 0){
                console.log(reStr);
            }
        }
    }

}


let p = new PrintChar("A",10);
p.for1();
console.log("----------------");
p.for2();
console.log("----------------");
p.for3();
